package com.seapeak.recyclebundle;

import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;

/**
 * 自定义高度的viewpapger
 */
public class RecyclerViewNoBugLinearLayoutManager extends LinearLayoutManager {
	public RecyclerViewNoBugLinearLayoutManager(Context context) {
		super( context );
	}

	public RecyclerViewNoBugLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
		super( context, orientation, reverseLayout );
	}

	public RecyclerViewNoBugLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
		super( context, attrs, defStyleAttr, defStyleRes );
	}

	@Override
	public boolean supportsPredictiveItemAnimations() {
		return false;
	}

	@Override
	public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
		try {
			//try catch一下
			super.onLayoutChildren(recycler, state);
		} catch (IndexOutOfBoundsException e) {
			e.printStackTrace();
		}

	}
}